package org.wjk.controller.service.impl;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.wjk.annation.CachaUsing;
import org.wjk.controller.mapper.SysMenuMppr;
import org.wjk.controller.service.SysMenuSvs;
import org.wjk.pojo.entity.SysMenuEntity;

import java.util.List;

/*该类为业务层类，该类对象交给Spring管理，该类实现SysMenuSvs*/
@Service
@RequiredArgsConstructor
public class SysMenuSvsImpl implements SysMenuSvs
{
    private final SysMenuMppr menuMppr;

    @Override
    @CachaUsing(key = "MENU")
    public List<SysMenuEntity> getUserAndHasMenus(Integer id)
    {
        return menuMppr.getUserAndHasMenus(id);
    }

    @Override
    public List<SysMenuEntity> getAllMenus()
    {
        return menuMppr.getAllMenus();
    }

    @Override
    public void addNewMenu(SysMenuEntity menu) {
        menuMppr.addNewMenu(menu);
    }
}
